package com.sinping.qh.repository.mongo.lab;

import com.sinping.qh.domain.lab.LaboratoryDomain;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author jiahuaiqing
 * @create 2018/6/1
 */
public interface LaboratoryRepository extends MongoRepository<LaboratoryDomain,String> {

    List<LaboratoryDomain> findLaboratoryDomainByUnitIdAndBuildingIdAndStatus(String unidId, String buildingId,String status);

    LaboratoryDomain findByIdAndStatus(String id,String status);
    /**
     * 通过实验室房间号查找
     */
    LaboratoryDomain findByRoomNo(String room);

    List<LaboratoryDomain> findLaboratoryDomainByUnitIdAndStatus(String unitId,String status);
    /**
     * 通过楼宇id查找
     */
    List<LaboratoryDomain>findAllByBuildingId(String buildingId);
    List<LaboratoryDomain>findAllByBuildingIdAndStatus(String buildingId,String status);
    /**
     * 通过楼宇名称和房间号来查找
     */
    List<LaboratoryDomain> findByBuildingNameAndRoomNoAndStatus(String buildingName,String roomNo,String status);
    /**
     * 通过单位id查找
     */
    List<LaboratoryDomain>findAllByUnitId(String unitId);
    List<LaboratoryDomain>findAllByUnitIdAndStatus(String unitId,String status);
    List<LaboratoryDomain>findAllByStatus(String status, Sort var1);

}
